package com.heima.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.service.ArticleConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author chenshan
 */
@RestController
@RequestMapping("api/v1/articleconfig")
public class ArticleConfigController {
    @Autowired
    private ArticleConfigService articleConfigService;

    /**
     * 文章的上架或下架
     * @param news 文章
     * @return ResponseResult
     */
    @PostMapping("down_or_up")
    public ResponseResult articleConfigDownOrUp(@RequestParam WmNews news) {
        return articleConfigService.articleConfigDownOrUp(news);
    }
}
